The present invention relates to a control apparatus and a control method of an AD converter of the serial output type which converts an analog signal into a digital signal in synchronization with a clock and outputs the digital signal sequentially bit by bit for each run of conversion. More particularly, the present invention relates to a control apparatus and a control method of an AD converter, which controls the converting operation and incorporation of conversion output of an AD converter by means of port output through control of a processor.
A serial output type AD converter has conventionally been used for processing an analog detection signal from a sensor which detects temperature or humidity exhibiting relatively small fluctuations with time, by incorporation thereof into a microprocessor. The serial output type AD converter converts an analog input signal into, for example, an 8-bit digital signal by supplying a clock signal and a chip select signal from outside bit by bit in compliance with a prescribed bit sequence from the highest level bit to the lowest level bit, and for each run of conversion, one converted bit is outputted as a bit data. A serial bit output from a AD converter is incorporated into a shift register in synchronization with a clock, and at the end of incorporation, 8-bit parallel data is obtained. In order for the AD converter to serially output an 8-bit digital signal, eight runs of converting operation based on the clock signal are required.
When enabling the chip select signal in synchronization with the clock signal, an L-level start bit is first output, and then converting operation takes place in synchronization with the clock signal. Each time, the 8-bit digital signal is sequentially output bit by bit from the higher-level bit. Upon the completion of output of the final bit, the AD converter outputs an H-level stop bit, and then disables the chip select signal to complete the AD converting operation of a cycle. In order to incorporate 8-bit parallel data by the use of a serial output type AD converter, therefore, there are necessary 11 clock signals, as calculated from the sum of the first chip select, the start bit output and the final stop bit.
Control of a serial output type AD converter has conventionally been performed by means of a dedicated hardware circuit. A manner of control comprises, for example, the step of dividing clock pulse of a microsecond order to a processor in a clock generating circuit to generate a clock signal for AD conversion of a millisecond order, which is fixedly supplied to the AD converter. Upon receipt of an instruction for AD conversion from the processor, a flip-flop of an output port is set in synchronization with this clock signal and a chip select signal is enabled. This causes the AD converter to begin converting operation in synchronization with the clock signal. The clock signal from the clock generating circuit is given also to an input port of the processor, and bit output taking place between the start bit and the stop bit is incorporated into a register to convert into parallel data.
One of the favorable merits of the serial output type AD converter is a low cost. A parallel output type AD converter commonly used can incorporate 8-bit parallel data with a single run of converting operation, and ensures high-accuracy and high-speed converting operation. However, the parallel type AD converter, requiring a high cost, is not suitable for an apparatus not requiring a high conversion speed or a high accuracy. A usual AD converter is provided with a sample hold circuit to sample-hold an analog signal and then convert it into a digital signal by the AD converter. However, temperature or humidity varies little during the time of AD conversion taking place in a millisecond order, rarely requiring sample holding. Therefore, when converting a detection signal from a sensor of temperature or humidity showing slightest fluctuations with time, a favorable merit of further reducing the cost is available by eliminating the sample hold circuit and directly making an input into a serial output type AD converter for conversion.
However, control of such a conventional serial output type AD converter had a problem in that, because control is fixedly performed by the hardware circuit in all cases, the hardware circuit increases according as the load on the processor is reduced, thus resulting in an increased cost. Much time and labor are required for circuit design to achieve: clock frequency or clock width cannot easily be changed in match with properties of the analog sensor. Malfunction of the AD converter prevents normal output of the start bit or the stop bit. It is difficult to identify such a malfunction with the hardware circuit from cost considerations because a complicated circuit configuration is required. A resulting problem is that abnormal data caused by the malfunction of the AD converter is directly incorporated into the processor, thus leading to abnormal control by the processor and a lack of reliability. In process control of temperature, for example, control of the heater by the processor without recognizing abnormal data of the sensor caused by malfunction of the AD converter may cause abnormal heating.